﻿cppei.install();

var app = angular.module('loginApp', []);
app.controller("loginCtr", function ($scope, $http) {

    $scope.onSubmit = function () {
        $http({
            method: 'post',
            url: cppei.api.getUrl('xweb', 'user', 'login'),
            data: { Account: $scope.username, Password: $scope.userpassword, IsAutoLogin: $scope.isautologin }
        }).success(function (data, status) {
            //debugger;
            if (data.isSuccess) {
                window.location.href = "index.html";
            }
            else {
                cppei.growlError(data.message);
            }
        }).error(function (data, status) {
            cppei.growl(data.message);
        });
    }
});